import React from 'react';
import { HashRouter, Route, Link, Switch } from 'react-router-dom';
import about from './about'
import topic from './topic'
import main from './main'

export default class Home extends React.Component {
  render() {
    return (
      <HashRouter>
        <div>
          <ul>
            <li>
              <Link to="/">首页</Link>
            </li>
            <li>
              <Link to="/about" >about</Link>
            </li>
            <li>
              <Link to="/topics">topics</Link>
            </li>
          </ul>

          <hr />

          <Switch>
            <Route path="/"  exact component={main}></Route>
            <Route path="/about" component={about}></Route>
            <Route path="/topics" component={topic}></Route>
          </Switch>
        </div>
      </HashRouter>
    )
  }
}